<template>
  <div class="min-h-screen bg-gray-50">
    <div class="max-w-md mx-auto p-4">
      <a-result
        status="success"
        title="支付成功"
        :sub-title="'订单号：' + orderNo"
      >
        <template #icon>
          <CheckCircleFilled style="color: #52c41a" />
        </template>
        <template #extra>
          <a-button type="primary" @click="goBack">返回首页</a-button>
        </template>
      </a-result>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { CheckCircleFilled } from '@ant-design/icons-vue'

const route = useRoute()
const router = useRouter()
const orderNo = ref(route.query.orderNo as string)

const goBack = () => {
  router.push('/')
}
</script>

<style scoped>
.payment-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
}

.result-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.result-icon.success {
  color: #67c23a;
}

h2 {
  font-size: 24px;
  margin-bottom: 16px;
  color: #303133;
}

.amount {
  font-size: 36px;
  font-weight: bold;
  color: #303133;
  margin-bottom: 16px;
}

.order-id {
  font-size: 14px;
  color: #909399;
  margin-bottom: 32px;
}

.actions {
  margin-top: 32px;
}
</style>